(* Factorielle (* version itérative *) *)        

let fact ( n : int ) : int =
    
       let f : int ref = ref 1 in
       let i : int ref = ref (-1) in
    
       begin 
         i := n;
         while ( !i <> 0 ) do
           f := !f * !i ;
           i := !i - 1
         done 
      end;
  !f
in
  
print_int( fact 5 ) ;;
